/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import {defHttp} from '/@/utils/http/axios';
import {useGlobSetting} from '/@/hooks/setting';
import {BasicModel, Page} from '../../model/baseModel';
import {UploadApiResult} from '../../sys/upload';
import {UploadFileParams} from '/#/axios';
import {AxiosProgressEvent} from 'axios';

const { ctxPath, adminPath } = useGlobSetting();

export interface CoreClwzjl extends BasicModel<CoreClwzjl> {
  clwzjlCph?: string; // 车牌号
  clwzjlPpxh?: string; // 品牌型号
  clwzjlClsbdm?: string; // 车辆识别代码
  clwzjlFdjhm?: string; // 发动机号码
  clwzjlWzrq?: string; // 违章日期
  clwzjlJsy?: string; // 驾驶员
  clwzjlWzdd?: string; // 违章地点
  clwzjlKfz?: number; // 扣分值
  clwzjlFkje?: number; // 罚款金额
  createByName?: string; // 创建人
  updateByName?: string; // 修改人
}

export const coreClwzjlList = (params?: CoreClwzjl | any) =>
  defHttp.get<CoreClwzjl>({ url: adminPath + '/cardd/wzjl/coreClwzjl/list', params });

export const coreClwzjlListData = (params?: CoreClwzjl | any) =>
  defHttp.post<Page<CoreClwzjl>>({ url: adminPath + '/cardd/wzjl/coreClwzjl/listData', params });

export const coreClwzjlForm = (params?: CoreClwzjl | any) =>
  defHttp.get<CoreClwzjl>({ url: adminPath + '/cardd/wzjl/coreClwzjl/form', params });

export const coreClwzjlSave = (params?: any, data?: CoreClwzjl | any) =>
  defHttp.postJson<CoreClwzjl>({ url: adminPath + '/cardd/wzjl/coreClwzjl/save', params, data });

export const coreClwzjlImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent | AxiosProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/cardd/wzjl/coreClwzjl/importData',
      onUploadProgress,
    },
    params,
  );

export const coreClwzjlDelete = (params?: CoreClwzjl | any) =>
  defHttp.get<CoreClwzjl>({ url: adminPath + '/cardd/wzjl/coreClwzjl/delete', params });

export const coreClwzjlUpdateClStatus = (params?: CoreClwzjl | any) =>
  defHttp.get<CoreClwzjl>({ url: adminPath + '/cardd/wzjl/coreClwzjl/updateClStatus', params });
